

auto_maintain_work_items = {
	"title": "Work Items",
	"comment": "This is the master (LEADS) table with all the leads on it. We might have to create some sort of facility to move a lead to the correct client, if we find it is some sort of duplicate",
	"sql_table": "work_items",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "customer",
			"alias": "customer",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Customer",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "customers",
				"key": "id",
				"value": "surname"
			}
		},
		{
			"name": "source_channel",
			"alias": "source_channel",
			"comment": "This value is set by the system and CANNOT be edited by any process or any user interaction",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Source Channel",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "source_channels",
				"key": "id",
				"value": "null"
			}
		},
		{
			"name": "work_item_reference",
			"alias": "work_item_reference",
			"comment": "This could be the same as the lead-number, but need to confirm with DEV how they want to implement.",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Reference Number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "external_reference",
			"alias": "external_reference",
			"comment": "We might have to keep a reference to the imported lead for future purposes....just making it available in-case...",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "External reference",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "parent_work_item",
			"alias": "parent_work_item",
			"comment": "This is important when agents create a member-get-member lead",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Parent Item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "priority",
			"alias": "priority",
			"comment": "this is a number represent what item should be worked on first. The smaller the number the higher the priority.",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "INT",
			"default_value": null,
			"title": "Priority",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "next_action_date",
			"alias": "next_action_date",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Next Action Date",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "lead_expiry_date",
			"alias": "lead_expiry_date",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Lead Expiry Date",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "assigned_agent",
			"alias": "assigned_agent",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Agent Assigned",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "assigned_on",
			"alias": "assigned_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Assigned On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "reason_code",
			"alias": "reason_code",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Reason Code",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "reason_codes",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "last_notes",
			"alias": "last_notes",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "MEDIUMTEXT",
			"default_value": null,
			"title": "Last notes",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edited_on",
			"alias": "last_edited_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "initial_work_list",
			"alias": "initial_work_list",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Initial Work List",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_list",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "current_work_list",
			"alias": "current_work_list",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Current work list",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_list",
				"key": "id",
				"value": "name"
			}
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_work_item_movement = {
	"title": "Work Item Movement",
	"comment": "",
	"sql_table": "work_item_movement",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "work_item",
			"alias": "work_item",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Work Item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_items",
				"key": "id",
				"value": "work_item_reference"
			}
		},
		{
			"name": "reason_code",
			"alias": "reason_code",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Reason Code",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "reason_codes",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "notes",
			"alias": "notes",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "MEDIUMTEXT",
			"default_value": null,
			"title": "Notes",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_work_list = {
	"title": "Work Lists",
	"comment": "This is the baskets or campaigns",
	"sql_table": "work_list",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "name",
			"alias": "name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "priority",
			"alias": "priority",
			"comment": "This can be as simple as a sort order. It just tells the system in what order you want the prioritise the leads.",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "INT",
			"default_value": null,
			"title": "Priority",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "is_active",
			"alias": "is_active",
			"comment": "if 0 then this items should not be available to anyone to work on or manage",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Active ?",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_notes_history = {
	"title": "Note History",
	"comment": "",
	"sql_table": "notes_history",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "work_item",
			"alias": "work_item",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Work item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_items",
				"key": "id",
				"value": "work_item_reference"
			}
		},
		{
			"name": "notes",
			"alias": "notes",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "MEDIUMTEXT",
			"default_value": null,
			"title": "Notes",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_reason_codes = {
	"title": "Reason Codes",
	"comment": "An outcome can essentially be one of the following categories. 1. Lead Converted; 2. Lead Lost; 3. Lead Diarised/Followup; 4. Lead Escalated; 5. System Type (to be used internally by the system)",
	"sql_table": "reason_codes",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "external_code",
			"alias": "external_code",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "External Code",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "name",
			"alias": "name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "can_close",
			"alias": "can_close",
			"comment": "This can be as simple as a sort order. It just tells the system in what order you want the prioritise the leads.",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Close Work Item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "can_diarise",
			"alias": "can_diarise",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Diarise Work Item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "can_create_sale",
			"alias": "can_create_sale",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Create Sale",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "can_escalate",
			"alias": "can_escalate",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Escalate",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "null",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_product_types = {
	"title": "Product Types",
	"comment": "Type of products that can be sold by the call-center.",
	"sql_table": "product_types",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "external_reference",
			"alias": "external_reference",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "External Reference",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "name",
			"alias": "name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "is_active",
			"alias": "is_active",
			"comment": "Only show products that has an \"Is Active\" state set to 1.",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Active ?",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_source_channels = {
	"title": "Source Channels",
	"comment": "Table that tells us extactly where the lead originated from. Initial values will include: 1. SMS; 2. 3-Ways; 3. Internal Capture; ",
	"sql_table": "source_channels",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "external_reference",
			"alias": "external_reference",
			"comment": "This is a code that the code will use to find the ID to use when the lead is generated. It is really up to the developers how it can be done. This is just a recommendation.",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "External Reference",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "name",
			"alias": "name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "work_list",
			"alias": "work_list",
			"comment": "Every source-channel MUST be linked to a basket. So that every incoming lead can be linked to a basket.",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Work list",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_list",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_work_item_products = {
	"title": "Work Item Products",
	"comment": "When products are sold against a lead, it is stored here",
	"sql_table": "work_item_products",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "work_item",
			"alias": "work_item",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Work item",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "work_items",
				"key": "id",
				"value": "work_item_reference"
			}
		},
		{
			"name": "product_type",
			"alias": "product_type",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Product Type",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "product_types",
				"key": "id",
				"value": "null"
			}
		},
		{
			"name": "policy_number",
			"alias": "policy_number",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Policy number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "reason_code",
			"alias": "reason_code",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Reason code",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "reason_codes",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT",
			"default_value": null,
			"title": "Created by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created on",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "removed_by",
			"alias": "removed_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT",
			"default_value": null,
			"title": "Removed by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "removed_on",
			"alias": "removed_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Removed on",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_customers = {
	"title": "Customers",
	"comment": "This is the master table for the clients. Keep the customer details seperate so that we can extend this later to start capturing clients details without making the leads table \"dirty\". Also this will become \"fun\" once we need to start detecting duplicates.... LOL",
	"sql_table": "customers",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "firstname",
			"alias": "firstname",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "First name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "surname",
			"alias": "surname",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Surname",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "fullname",
			"alias": "fullname",
			"comment": "this is a concatenation of hte first name and last name",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Full name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "salutation",
			"alias": "salutation",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "Salutation",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "salutations",
				"key": "id",
				"value": "name"
			}
		},
		{
			"name": "mobile_number",
			"alias": "mobile_number",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Mobile number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "home_number",
			"alias": "home_number",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Home number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "work_number",
			"alias": "work_number",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Work number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "alternate_number",
			"alias": "alternate_number",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Alternate number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "physical_address",
			"alias": "physical_address",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Physical Address",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "postal_address",
			"alias": "postal_address",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Postal Address",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "can_contact_in_future",
			"alias": "can_contact_in_future",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "SMALLINT",
			"default_value": null,
			"title": "Can contact me ?",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created on",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit By",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_banking_details = {
	"title": "Banking details",
	"comment": "Need to make sure banking details are valid, so we use something like: 1. http://www.acblink.co.za; 2. http://mygate.co.za/products/bank-account-validation",
	"sql_table": "banking_details",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "customer",
			"alias": "customer",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "lookup",
			"default_value": null,
			"title": "customer",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__",
			"foreign_key": {
				"sql_table": "customers",
				"key": "id",
				"value": "surname"
			}
		},
		{
			"name": "bank_name",
			"alias": "bank_name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Institution name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "branch_code",
			"alias": "branch_code",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Branch code",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "account_number",
			"alias": "account_number",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(20)",
			"default_value": null,
			"title": "Account Number",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "account_holder_name",
			"alias": "account_holder_name",
			"comment": "",
			"nullable": false,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(100)",
			"default_value": null,
			"title": "Account holder",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "validated_on",
			"alias": "validated_on",
			"comment": "This should be set to NULL untill the account details has been validated. Anytime ANY information is edited on this record, then this field should be set to NULL to indicate that the banking details is not validated.",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Validated On",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_by",
			"alias": "created_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Created by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "created_on",
			"alias": "created_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Created on",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_by",
			"alias": "last_edit_by",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "Last Edit by",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "last_edit_on",
			"alias": "last_edit_on",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "DATETIME",
			"default_value": null,
			"title": "Last Edit on",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}

auto_maintain_salutations = {
	"title": "Salutation",
	"comment": "",
	"sql_table": "salutations",
	"ajax_url": "./lookup_tables.php",
	"server_call_list": "lookup_read",
	"server_call_create": "lookup_create_item",
	"server_call_update": "lookup_update_item",
	"server_call_remove": "lookup_remove_item",
	"server_call_import": "lookup_create_item",
	"fields": [
		{
			"name": "id",
			"alias": "id",
			"comment": "",
			"nullable": false,
			"auto_increment": true,
			"primary_key": true,
			"data_type": "BIGINT(20)",
			"default_value": null,
			"title": "ID",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		},
		{
			"name": "name",
			"alias": "name",
			"comment": "",
			"nullable": true,
			"auto_increment": false,
			"primary_key": false,
			"data_type": "VARCHAR(50)",
			"default_value": null,
			"title": "Name",
			"show_on_import": true,
			"show_on_grid": true,
			"show_on_editor": true,
			"readonly": false,
			"ui_group": "__MAIN__"
		}
	],
	"ui_groups": [
		{
			"name": "__MAIN__"
		}
	]
}
